# coding=utf-8
from sqlalchemy import Column, Integer, String

from db_models.orm_base import BaseOrmClass


class Applications(BaseOrmClass):
    '''
    模型(表)备注:应用服务
    '''
    __tablename__ = 'applications'

    '''      '''
    allow_ips = Column(String(), nullable=False)

    '''      '''
    app_key = Column(String(32), primary_key=True)

    '''      '''
    app_secret = Column(String(43), nullable=False)

    '''   其他表使用的时候使用该id,否则查询就太慢了.   '''
    id = Column(Integer())

    '''   应用名称.   '''
    name = Column(String(100))

    def __repr__(self):
        return "applications(allow_ips='{self.allow_ips}',app_secret='{self.app_secret}')".format(self=self)

    def exclude(self): return ()
